package com.tudouji.project.bill.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.tudouji.framework.aspectj.lang.annotation.Excel;
import com.tudouji.framework.web.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 出库单对象 whoutform
 * 
 * @author wf
 * @date 2021-01-12
 */
@Data
public class Whoutform
{
    private static final long serialVersionUID = 1L;


    /** 出库编码 */
    @Excel(name = "出库编码")
    private String whoutcode;

    /** 业务关联编号 */
    @Excel(name = "订单编码")
    private String businesscode;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "出库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date outtime;

    @Excel(name = "出库类型")
    private String outtypename;

    /** 组织名称 */
    @Excel(name = "组织名称")
    private String orgname;
    private String orgFullName;

    @Excel(name = "库房")
    private String storeroom;

    @Excel(name = "库间")
    private String house;

    @Excel(name = "产品")
    private String product;

    @Excel(name = "规格")
    private String spename;

    /** 重量 */
    @Excel(name = "数量")
    private BigDecimal weight;

    @Excel(name = "单位")
    private String stockunit;

    @Excel(name = "内部价")
    private BigDecimal innerPrice;

    @Excel(name = "结算组织")
    private String settlOrgName;

    @Excel(name = "客户")
    private String revCustName;

    @Excel(name = "操作人")
    private String operator;

    private List<Whoutformitem> items;





    /** $column.columnComment */
    private Long autoid;

    /** guid */
    private String guid;



    /** 出库类型 */
    private Integer outtype;

    /** 库房guid */
    private String srguid;

    /** 订单guid */
    private String orderguid;

    /** 组织guid */
    private String orgguid;



    /** 物流公司id */
    private String wlcompanyid;

    /** 物流公司名称 */
    private String wlcompany;

    /** 司机姓名 */
    private String drivername;

    /** 司机电话 */
    private String driverphone;

    /** 车牌号 */
    private String carcode;

    /** 出库时间 */


    /** 操作人 */
    private String operatorid;





    /** 结算组织id */
    private String settlOrgId;

    /** 收货客户id */
    private String revCustId;


    /** 币种(1-人民币2-美金) */
    private Integer currency;

    private String remark;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createtime;

    private Integer dataNum;

    private List<Whoutformitem> whoutformitemList;

    private String spid;

    private String productid;


    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date beginCreatedate;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endCreatedate;

    private String types;

    //条件
    private String conditions;

    private String departmentid;

    private String shrguid;

    private Integer type;

    private String [] srguids;


    private Integer isCopytoKD;

    private Integer notisCopytoKD;

    private Integer loadcount;

    private BigDecimal lbweight;

    private BigDecimal price;


    //渠道类型
    private String channel;

    //外部渠道的交易
    public boolean isExternalChannel(){
        return channel!=null && !channel.equalsIgnoreCase("internal");
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Whoutform whoutform = (Whoutform) o;
        return autoid.equals(whoutform.autoid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(autoid);
    }
}
